package com.example.java_service.impl;

import com.example.java_dao.BrandDao;
import com.example.java_pojo.Brand;
import com.example.java_service.BrandService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

@Service
public class BrandServiceImpl implements BrandService {
    @Autowired
    private BrandDao brandDao;

    public List<Brand> selectAll() {
        return brandDao.selectAll();
    }

    public boolean add(Brand brand) {
        brandDao.add(brand);
        return true;
    }

    public boolean update(Brand brand) {
        brandDao.update(brand);
        return true;
    }

    public boolean delete(Integer id) {
        brandDao.delete(id);
        return true;
    }

    public List<Brand> selectBrand(String company_name, String brand_name){
        return brandDao.selectBrand(company_name,brand_name);
    }

    public boolean deleteByIds(Integer[] ids){
        brandDao.deleteByIds(ids);
        return true;
    }
}
